package com.bang.concurrency.example.threadLocal;

/**
 * @Auther: Bang
 * @Date: 2019/9/30 22:46
 * @Description: 线程封闭 threadLocal
 */
public class RequestHolder {

    private static final ThreadLocal<Long> requestHolder = new ThreadLocal<>();

    public static void add(Long id) {
        requestHolder.set(id);
    }

    public static Long get() {
        return requestHolder.get();
    }

    public static void remove() {
        requestHolder.remove();

    }
}
